<div id="content" class="block" style="padding-top: 50px">
<?php
foreach ($entries as $entry)
{
    $comments = getListComment($entry['EntryId']);        
    include 'view_item.php';
}
?>
<script type="text/javascript">
$('h4.title').hide();
$('.img-content').hover(
    function(e) //Mouseover
    {
        $(this).find('.title').slideDown('slow');
    },
    function(e) //Mouseout
    {
        $(this).find('.title').slideUp('slow');
    }
);

$('.bt-addfriend').hide();

function submitComment(element) //Callback submit form comment
{
    $(element).find('textarea').val($(element).find('textarea').val().trim());
    $.post('?com=content&action=comment', $(element).serialize(), function(data, status){
        if(status != 'success')
        {
            alert('Cannot comment, some errors has occured, please try again! ');
        }
        else
        {
            $(data).appendTo($('.list-comments'));
        }
    });
    return false;
};

$('#content').find('textarea[name="comment"]').keydown(function(e)
{
    if(e.keyCode === 13) //Nếu nhấn phím Enter sẽ gửi comment lên server
    {
        $(this).closest('form').submit(); //Submit form
        $(this).val('');
    }
});
</script>
</div>
<?php
include 'components/friend/view.php';
?>
